The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
Why not run it on the latest version of LFS to start with?
Then, if you want help with a script, it might be a good idea to attach the script, as we can then have a look at it and help you.
Now we have to guess what is going on, which is a waste of time Smile
LFS Lapper: Multiple penalties
Yisc[NL]
S3 licensed
As promised, by view on how to do multiple penalties:

1) Add the code below to the OnLap event. When a driver completes a lap, Lapper will see if that player hasn't got an active penalty (PenaltyNew == 0) AND if PlayerVar 'reset_abuse' is set to "true". If so, give the player a 45 sec penalty


Event OnLap( $userName ) # Player event
IF ( GetCurrentPlayerVar ( "PenaltyNew" ) == 0 && GetCurrentPlayerVar ( "reset_abuse" ) == "true" )
THEN
cmdLFS( "/p_45 " . $userName );
ENDIF
EndEvent

2) Add the code below to the OnRaceStart event. This is to clear PlayerVar 'reset_abuse' for every player that starts the race (in case there are multiple races)


Event OnRaceStart( $NumP ) # Lapper event
$mList = GetListOfPlayers("N");
$mCount = arrayCount( $mList );
$plyNum=0;
$players_on_track=0;

WHILE ($plyNum < $mCount)
$uName = $mList[$plyNum];
SetPlayerVar( $uName,"reset_abuse","" );
$plyNum=$plyNum+1;
ENDWHILE
EndEvent

3) When applying ResetPenalty, set PlayerVar 'reset_abuse' to "true"


Sub ApplyCarResetPenalty( $userName )
IF( GetCurrentPlayerVar( "LapsDone" ) > 0 )
THEN
IF( getLapperVar( "RaceLapsLeft" ) <= 1 )
THEN
cmdLFS( "/p_30 " . GetCurrentPlayerVar( "UserName" ) );
ELSE
cmdLFS( "/p_sg " . GetCurrentPlayerVar( "UserName" ) );
SetCurrentPlayerVar ( "reset_abuse","true" );
ENDIF
ENDIF
EndSub

Yisc[NL]
S3 licensed
I think that writing in capitals on an online platform is considered as shouting and therefor rude behavior.
I also think that it would be better to write a well written first post when starting a thread.
As in, describe carefully what it is you want to hear from others and what your own opinion is to start with.

The thread is about a comparison between Asetto Corsa and LFS.
Yisc[NL]
S3 licensed
Quote from ScottLy :If you give one penalty, and a second one
2nd one will overwrite 1st penalty

I dont think that its possible to give 2 penalties at the same time. Or Am I Wrong?

You are right about that, but I think I have come up with a way to solve that issue, as in "storing the second penalty for later on".
Just haven't got the time to work it out tonight, so will come back to the subject in the next few days.
Oval lights controller - V1.01
Yisc[NL]
S3 licensed
Small update (V1.01) to this script with the following change log:

-Made the main lights blink left one / right one on command !ylw
-Added code to switch off actions on Yellow when going straight into !grn

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Have a go with the attached script.
It does all that you asked for, except the blinking yellow lights on main, as there is no yellow state on them.
So made them blink red.

I've put the commands !ylw , !rdy , !grn under my F5,F6,F7 (you need to do that in your own LFS settings (see screenshot) and it's working as intended.

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
I've found a bug in this addon.
When using command "!dsoff" or "!rds" the following error is logged:

Syntax error: Incorrect number of arguments at line #154 in function 'closedragresults' script aborted

The problem is in file 'Drag_Finish.lpr' at line 154 which is:

Sub CloseDragResults($keyflags,$id)

This line should be changed to:

Sub CloseDragResults()
Points system V1.05
Yisc[NL]
S3 licensed
Changelog Points system V1.05

-Added code to send a global message when a player receives 1 point for completing a lap

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Points system V1.04
Yisc[NL]
S3 licensed
Changelog Points system V1.04

-Added code to give one point for every completed lap
-Added code for a ranking system
-Added code to delete stored rank when using !delpoints command
-Added code to cap maximum number of points at 50000
-Added code to make rank visible when using !point and !rank command
-Fixed a bug in !point and !rank where Flagnear wasn't working

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Quote from Tomfuel :a friend team has a fully fonctionnal server in RS with 6.0.1.3
version
i want the same ...

RS does not want to change if i can't provide them a download link

This is the download link for Lapper 7.0.6.3: https://www.lfs.net/attachment/189673
Yisc[NL]
S3 licensed
I am sure you want this version to be released (soon) at some point, but I like to make a request for this or next version.

To be able to use CarBehind in the OnPlayerFlags event.
The needed information is in the InSim packet:


struct IS_FLG // FLaG (yellow or blue flag changed)
{
byte Size; // 8
byte Type; // ISP_FLG
byte ReqI; // 0
byte PLID; // player's unique id

byte OffOn; // 0 = off / 1 = on
byte Flag; // 1 = given blue / 2 = causing yellow
byte CarBehind; // unique id of obstructed player
byte Sp3;
};

Last edited by Yisc[NL], .
Points system V1.03
Yisc[NL]
S3 licensed
Changelog Points system V1.03

- Removed "$ps_max_points=10" from OnLapperStart as it no longer has a purpose
- Made the display of points earned dynamic
- Added option (only for admins) to delete all points related records from the database

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
I have looked into your script and it turned out that an ENDIF was missing.
There was also too much complicated code to make the rank-cases work, so I have re-written that:


<?php 
SWITCH( $command )

    CASE 
"!promote":
    IF ( 
UserIsAdmin$userName ) == )
    
THEN
        
IF ( $argv != "" 
        
THEN
        $idxSpace 
indexOf$argv" ");
        IF ( 
$idxSpace != -
        
THEN
            $pl_name 
subStr$argv,0,$idxSpace ); #user- or nickname
            
$rank trimsubStr$argv,$idxSpace ) ); #rank

            
IF ( $rank != "")
            
THEN
                
SWITCH ( ToLower($rank) )    

                CASE 
"cadet":
                    
privMsg"test" );
                    IF ( 
UserInGroup"Police",$pl_name ) == )
                    
THEN
                        privMsg
"^7User is already A Officer!!!");
                    ELSE
                        
MoveUserToGroup"Police",$pl_name );
                        
UserGroupToFile"Police"$Dir["Police"] );
                        
GlobalMsglangEngine"%{cruise_cop_new}%",$pl_name) );
                    ENDIF
                BREAK;

                CASE 
"officer":
                    
privMsg"test Officer");
                BREAK;

                CASE 
"oc":
                    
privMsg"test OC");
                BREAK;
                ENDSWITCH
            ELSE
            
privMsg"Select player" );
            ENDIF
        ENDIF
        ELSE
        
privMsg "Specify Cadet, Officer or OC" );
        ENDIF
    ENDIF 
#THIS WAS MISSING
    
BREAK;
ENDSWITCH
?>

Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
This is a question about Lapper and should have gone into the Lapper forum section. Maybe a moderator can direct this thread to the correct forum?
I will look into your question and will come up with an answer.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Quote from Vilix :I see. I did not know that it was developed by a single person, which explains a bit about the development speed. However, I disagree with the statement that "it's being developed to make the best simulator possible." Wouldn't you agree that by adding things like weather conditions and minor details like concrete cracks would make it a better simulator? As you said I'm not a complete expert on LFS, but from a casual players perspective this is my opinion.

Day/night , weather , visual improvements would add to the overal feeling the game has, but it won't make it a better simulator.
The new tyre model that is being developed will.
If all goes to plan, the next update (no promises, no estimate when it will be read) should include the new tyre mode, day/night cycle and moving DirectX up to version 11 (coming from 9), which will give the graphics artist (Erik) a lot more options, while he has already given most tracks (every track when the new update goes live) a huge graphical update.

You might want to read these articles, written by Scawen:

https://www.lfs.net/forum/thread/94032-March-Progress-Report---LFS-in-Direct3D-11
https://www.lfs.net/forum/thread/93766-December-Progress-Report%3A-South-City
https://www.lfs.net/forum/thread/93689-October-Progress-Report
https://www.lfs.net/forum/thread/93569-July-Progress-Report
https://www.lfs.net/report-aug2018-bl
https://www.lfs.net/report-dec2018-au

It shows you how much is going on and what has been worked on.
LFS is very much alive, but with a single developer and one graphics artist, things go slow, but steady and with always the highest quality possible in mind.
https://www.lfs.net/forum/thread/93420-April-Progress-Report
Yisc[NL]
S3 licensed
I have stopped reading after point 1a. You clearly have no idea how LFS is developed (by a single guy) and that it isn't being developed to make as much money as possible, but to make the best simulator possible.

Modding has been suggested many times before and Scawen (dev of LFS) has said that at the moment he has no intention to open up the game for officially supported mods or modding of the game.
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
Changelog Points system V1.02

- Added code to give extra points to the player that drove the fastest lap of the race (Yisc[NL])
- Removed several lines of closeGlobalButton, since the button ID's that were closed were not in use (Yisc[NL])

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.

Credits to:

Tim NL - For creating the initial script
Bass-Driver - For making the code to show a toplist
Last edited by Yisc[NL], .
Yisc[NL]
S3 licensed
I seems that Rackservice deploys 6.0.1.3 by default as I just had another user reporting that version to me.
Strange, as that's a really old version.
Yisc[NL]
S3 licensed
Quote from sinanju :I use Rackservice too Smile

Just checked, and the version of lapper I'm using on Rackservice is V6.0.1.3.

Don't know if anyone else on Rackservice is using a newer version, or if we're all using same one.

I use Filezilla to transfer files back and forth between Rackservice and my pc when I want to update and backup. I used Filezilla to download copy of the lfslapper.exe file, then checked properties.

That's a very old version.
Tomfuel is on 7.0.6.3 , which is the most recent stable version of Lapper.
Yisc[NL]
S3 licensed
The messages are just the messages and can never trigger a race start, unless some other code is active to do such thing. If you want me to, I can have a look at the full script and see if I can find what causes these starts. Feel free to send me a private message, so I can share my email address with you, which then allows you to send me your script (or if you have multiple ones, the full Lapper directory).

Welcome text needs to go into the OnConnect event.
I made this for the team (AB.nl) I am developing things for:

Welcome screen
Lapper Points system
Yisc[NL]
S3 licensed
I have converted the script made by Tim NL into a Lapper module and adjusted the code if needed (some functions he used, have been removed from Lapper).
Here's the new module, that has been tested by me, but needs the score of a couple of people to see if it is really working like it should.

Change the extension of the file to .lpr and add it to addonsused.lpr to be able to use it.

Credits to:

Tim NL - For creating the initial script
Bass-Driver - For making the code to show a toplist
Yisc[NL]
S3 licensed
Are you sure that is caused by Lapper?
I mean, people can just vote to start a race, which is an LFS function and not a Lapper function.
The code you disabled hasn't got anything to do with starting a race.

globalMsg = messages send to everyone who is on the server
privMsg = messages send to that particular player, who triggered the event
Yisc[NL]
S3 licensed
Help given, no feedback, thread closed.
Yisc[NL]
S3 licensed
Over night I have been thinking about how this blue flag penalty could be implemented, but it doesn't seem to be a straight forward thing.

When a player is slow for a reason (skills, technical issue on the car, been in an accident, etc.) the whole field will lap him/her at some point. That means a lot of blue flags will be given, but only counting them isn't doing justice to the player that gets them. I mean, maybe he/she moves out of the way ASAP but since then the next car will appear, the flag count will go up and up. A way to go around that is to count the number of flags within a given time period, but then again, when all the cars are catching up, it still might be too many flags within X seconds.

As far as I know, Lapper can't indicate which players causes you to get a blue flag. It would help to be able to know that Player A gets a blue flag because of Player B and if those are too many, you could apply a penalty. Then the counting starts again when Player A gets a blue flag because of Player C.
I have no idea if there's an Insim packet to get that information and if so, if Bass-Driver would be willing to implement it.
Yisc[NL]
S3 licensed
Quote from Tomfuel :great Yisc Thumbs up, i will try it but where are the penalties and no idea to create it !
i will search and submit

You can give penalties with these commands:


cmdLFS( "/p_30 " . GetCurrentPlayerVar( "UserName" ) );
cmdLFS( "/p_45 " . GetCurrentPlayerVar( "UserName" ) );
cmdLFS( "/p_dt " . GetCurrentPlayerVar( "UserName" ) );
cmdLFS( "/p_sg " . GetCurrentPlayerVar( "UserName" ) );

Penalties:

/p_30 USERNAME :give 30 second time penalty
/p_45 USERNAME :give 45 second time penalty
/p_dt USERNAME :give drive through penalty
/p_sg USERNAME :give stop-go penalty
FGED GREDG RDFGDR GSFDG